<?php
$products = new Table('products');

$products->set_relations(array(
		'category_id'	=> array('category', 'id', 'name'),
		'status'	=> array('product_status', 'id', 'name')
));

$category = !empty($_GET['cat']) ? $_GET['cat'] : 1;
$products->select(  array(
							array('category_id', $category, '=')));

$_tpl->set(array(
	'products'	=> get_table_data($products)
));
?>